﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using SurfaceCardsBoardLibrary.Interfaces;

namespace SurfaceCardsBoardLibrary
{
    public class BoardItemTemplateSelector : DataTemplateSelector
    {
        private DataTemplate cardTemplate;

        public DataTemplate CardTemplate
        {
            get { return cardTemplate; }
            set { cardTemplate = value; }
        }

        private DataTemplate deckTemplate;

        public DataTemplate DeckTemplate
        {
            get { return deckTemplate; }
            set { deckTemplate = value; }
        }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is ICard)
            {
                return cardTemplate;
            }
            else
            {
                return deckTemplate;
            }
        }
    }
}
